package com.ymatou.iapi.payment.service;

import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;
/**
*支付收单Call
*FreeMaker Template自动生成代码
*/
public class AcquireOrderCall extends YmatouBaseCall{
	private static String opurl ="api/AcquireOrder";
	
	public AcquireOrderCall() {
		super(EnvSetup.getSystemUrl("payment_iapi"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	/**
	 * 获取errorCode
	 * 
	 * @return
	 */
	public String getErrorCode() {
		String errorCode = null;
		try {
			errorCode = new JSONObject(getReturnData()).getString("ErrorCode");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return errorCode;
	}
}